<template>
  <a-card style="margin-top: 16px;">
    <div class="ant-card-head-wrapper">
      <div class="ant-card-head-title">
        <span class="title">评价</span>
        <span class="subtitle">数据时间：{{dataDate}}</span>
      </div>
      <div class="ant-card-extra">
        <a-button type="primary" @click="handleType('points')">查看详情<a-icon type="caret-right" /></a-button>
      </div>
    </div>
    <div class="card-content">
      <a-card :bordered="false">
        <a-row>
          <a-col :sm="24" :lg="24">
            <p class="subtitle">评价维度</p>
            <pie :width="'100%'" :height="'277px'" :data="scenePieData"></pie>
          </a-col>  
          <!-- <a-col :sm="12" :lg="12">
            <p class="subtitle">行为</p>
            <pie :width="'100%'" :height="'277px'" :data="actionPieData"></pie>
          </a-col> -->
        </a-row>
      </a-card>
    </div>
  </a-card>
</template>
<script>
import { getAction } from '@/api/manage';
import StackedLine from "@/components/Echarts/StackedLine.vue";
import Pie from "@/components/Echarts/areaPie.vue";

export default {
  name: 'notes',
  components: {
    Pie, 
    StackedLine
  },
  props:[],
  data() {
    return {
      url: {
        queryData:"/management/skStudentEvaluation/getStudentDimensionEvaluationWithDay"
      },
      studentId: '',
      dataDate: '',
      nextDate: '',
      pageSize: 5,
      commentYData: [],
      scenePieData: [],
      actionPieData: []
    }
  },
  filters: {},
  
  computed: {},
  
  created() {
    this.dataDate = this.$skCommon.getDate(0)
    this.nextDate = this.$skCommon.getDate(0)
  },
  
  activated() {
  },

  mounted() {
    // this.commentYData.push(15,25,23,65,45,23);
    this.scenePieData.push(
      // {name:"科学活动",value:20},
      // {name:"艺术活动",value:23},
      // {name:"区域",value:24},
      // {name:"认知力",value:26},
      // {name:"表现力",value:27},
    )
    this.actionPieData.push(
      // {name:"协调力",value:20},
      // {name:"领导力",value:23},
      // {name:"力量",value:24},
      // {name:"灵活力",value:26},
    )
  },

  methods: {
    load(dataForm) {
      this.dataDate =  dataForm.dataDate
      this.nextDate =  dataForm.dataDate
      this.studentId = dataForm.studentId
      this.loadPoints();
    },
    loadPoints() {
      const params = {
        studentId:this.studentId,
        queryDate:this.dataDate
      }
      this.scenePieData = []
      getAction(this.url.queryData,params).then((res)=>{
        if(res.success){
          res.result.forEach(item => {
            this.scenePieData.push(
              {name:item.dimensionName,value:item.totalNum}
            )
          });
        } else {
          this.$message.warning(res.message);
        }
      }).catch((error)=>{
        console.error(error);
      })
    },
    handleType(type){
      this.$emit('detail', type)
    },
  }
}
</script>
<style scoped lang="less">

</style>